<!-- 修改 -->
<%@ page language="java" import="dao.*" pageEncoding="UTF-8" %>
<%@ page language="java" import="java.util.*" %>
<%@page import="util.*" %>


<div class="yz-header">
    <div class="header">
        <div class="header_content" style="text-align: center;position: relative">
            <span style="position: absolute;left: 0px;"><a href="./">SWU二手交易平台系统</a></span>
            <span class="header_hotline"></span>
            <div class="" style="padding-top: 16px">
                <div class="select">
                <!--hjw  getSession:从当前request中获取session，如果获取不到session，则会自动创建一个session，
                	默认为true,并返回新创建的session getAttribute() 方法返回指定属性名的属性值-->
                    <% if (request.getSession().getAttribute("username") != null && !("".equals(request.getSession().getAttribute("username")))) { %>
                    欢迎<%= request.getSession().getAttribute("username") != null ? request.getSession().getAttribute("username") : "" %>
                    登录，
                    您得权限：<%= request.getSession().getAttribute("cx") != null ? request.getSession().getAttribute("cx") : "" %>

                    <a class="btn btn-primary btn-xs" href="main.jsp"> 个人中心</a>
                    <a class="btn btn-default btn-xs" href="logout.jsp" onclick="return confirm('你确定退出？')">退出</a>
                    <% } else { %>



                    <button onclick="location.href='yonghuadd.jsp'" class="btn btn-primary btn-xs">注册</button>
                    　&nbsp;
                    <!--  hjw  弹窗登录窗口：（Bootstrap）modal是模态框，覆盖在父窗体上的子窗体
                    data-toggle，data-target一起使用就是代表data-target所指的元素以data-toggle指定的形式显示
                    data-toggle="modal"，HTML5 自定义的 data 属性 data-toggle 用于打开模态窗口
                    data-target指事件的目标,是指将#loginModel这个Dom元素的内容以模态框的形式展示
                     -->
                    <button type="button" class="btn btn-primary btn-xs" toggle="modal" data-toggle="modal"
                            data-target="#loginModel">登录  </button>

                  
                    <% } %>
                </div>


            </div>
        </div>
    </div>

    <div class="nav">
        <div class="left nav_one nav_common">
            <span><a href="./">主页</a></span>
        </div>

        <div class="left nav_one nav_common">
<span><a href="shangpinxinxilist.jsp">所有商品
</a></span>

            <div class="dropmenu">
                <div class="triangle"></div>
                <div class="dropmenu_bg"></div>
                <div class="dropmenu_content dropmenu_content_eight">
                    <h3>所有商品</h3>
                    <%
                        List<HashMap> mapshangpinfenlei1 = new CommDAO().select("SELECT id,fenleimingcheng FROM shangpinfenlei");
                    %>
                    <% for (HashMap m : mapshangpinfenlei1) { %>



                    <a href="shangpinxinxilist.jsp?shangpinfenlei=<%= m.get("id") %>"><%= m.get("fenleimingcheng") %>
                    </a>
                    <% } %>
                </div>
            </div>
        </div>


        <div class="left nav_one nav_common">
            <span><a href="login.jsp">后台</a></span>
        </div>
    </div>
    <!-- hjw  Modal： 此处id=""对应上面data-targrt -->
    <div class="modal fade" tabindex="-1" role="dialog" aria-labelledby="0" id="loginModel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true">×</span></button>
                    <h4 class="modal-title" id="0">登录</h4>
                </div>
                <div class="modal-body">
                    <div class="pa10">
                        <form action="login?ac=login&a=a" method="post"><!-- form 标签开始 -->
                            <div class="form-group">

                                <input type="text" class="form-control" name="username" placeholder="输入帐号"/></div>
                            <div class="form-group">

                                <input type="password" class="form-control" name="pwd" placeholder="密码"/></div>
                            <div class="form-group">

                                <select class="form-control" name="cx">
                                    <option value="用户">用户</option>
                                </select></div>
                            <div class="form-group">

                                <div class="input-group">
                                    <input type="text" class="form-control" name="pagerandom" placeholder="输入验证码"/><span
                                        class="input-group-addon"><img src="image.jsp"
                                                                       style="width: 60px;height: 20px;max-width: none; max-height: none;"
                                                                       onclick="this.src='image.jsp?rand='+new Date().getTime()"/></span>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="row">
                                    <label style="width: 120px;min-height:18px;text-align: right"
                                           class="col-sm-2"> </label>
                                    <div class="col-sm-8">
                                        <button type="submit" class="btn btn-primary">
                                            登录
                                        </button>
                                    </div>
                                </div>
                            </div><!--form标签结束--></form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>



